using System;
using System.Collections.Generic;
using System.Text;
using VSSDKAssist.Assets.Converters;
using VSSDKAssist.Enums;
using System.ComponentModel;

namespace VSSDKAssist.Recipes.Common.Converters
{
	/// <summary>
	/// TypeConverter for Visual Studio Editions enum
	/// </summary>
	public class VSEditionConverter : StandardValuesConverterBase
	{
		#region Public Implementation
		/// <summary>
		/// Returns a collection of standard values for the data type this type converter is designed for when provided with a format context.
		/// </summary>
		/// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null.</param>
		/// <returns>
		/// A <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection"></see> that holds a standard set of valid values, or null if the data type does not support a standard set of values.
		/// </returns>
		public override StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context)
		{
			List<string> editions = new List<string>();

			foreach(string hive in VSEdition.Values.Values)
			{
				editions.Add(hive);
			}

			return new StandardValuesCollection(editions);
		}
		#endregion
	}
}